#ifndef CONTROL_BASE_HPP
#define CONTROL_BASE_HPP

#include "ui/ui_item.hpp"
#include "content/data_provider.hpp"

class ui_control : public ui_item
{
public:
    using ui_item::ui_item;
    void bind(bindable_base *data) override final;
protected:
    virtual void update_data(bindable_base* data) = 0;

    void init_content(const xml_node &node) override;

    void before_draw() override final;
    void after_draw() override final;
    void draw_children() override final; // controls must have no children!!

    data_provider_p caption_{};
    data_provider_p helper_{};
};

#endif // CONTROL_BASE_HPP
